﻿
using Cms.Core.Application.IService;
using Cms.Core.AspNetMvc.Mvc;
using Cms.Core.Infrastructure;
using Cms.Core.Infrastructure.Ui;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace Cms.Core.Web.Controllers
{
    /// <summary>
    /// 实体审计信息
    /// </summary>
    [Display("实体审计信息")]
    public class AuditEntryController : WebApiController
    {

        private readonly IAuditEntryService _auditEntryService;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="auditEntryService"></param>
        public AuditEntryController(IAuditEntryService auditEntryService)
        {
            _auditEntryService = auditEntryService;
        }

        /// <summary>
        /// 异步得到实体审计分页数据
        /// </summary>
        /// <param name="requestData"></param>
        /// <returns></returns>
        [Display("异步得到实体审计分页数据"), HttpPost]
        public async Task<PageData> GetAuditEntryPageDataAsync([FromBody] PageRequestData requestData)
        {

            var pageData = await _auditEntryService.GetAuditEntryPageDataAsync(requestData);
            return pageData.ToPageData();
        }
    }
}